import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView
    // },
    {
      path: '/',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/MainView.vue'),
      children: [
        {
          path: '/GoodListView',
          name: 'GoodListView',
          component: () => import('../views/Good/GoodListView.vue')
        },
        {
          path: '/GoodDetailView',
          name: 'GoodDetailView',
          component: () => import('../views/Good/GoodDetailView.vue')
        },
        {
          path: '/DetailCultivationView',
          name: 'DetailCultivationView',
          component: () => import('../views/Detial/DetailCultivationView.vue')
        },
        {
          path: '/DetailprocessView',
          name: 'DetailprocessView',
          component: () => import('../views/Detial/DetailprocessView.vue')
        },
        {
          path: '/DetailSlaughterView',
          name: 'DetailSlaughterView',
          component: () => import('../views/Detial/DetailSlaughterView.vue')
        },
      ]
    }
  ]
})

export default router
